package com.why.simpleboot.core.boot.starter;

import com.why.simpleboot.core.server.netty.SimpleBootHttpServer;


/**
 * @program: why-simpleboot-framework
 * @description:
 * @author: @why
 * @create: 2021-05-27 19:14
 **/

public final class SimpleBootNettyStarter extends AbstractSimpleBootStarter {
    private static final SimpleBootHttpServer SIMPLE_BOOT_HTTP_SERVER = new SimpleBootHttpServer();

    @Override
    protected void serverStart() {
        SIMPLE_BOOT_HTTP_SERVER.serverStart(super.APPLICATION_CONTEXT, super.DEFAULT_SCAN_PACKAGES.toArray(new String[0]));

    }

    /**
     * StackTrace(堆栈轨迹)可以认为是一系列方法调用过程的集合。
     *
     * @return
     */
    private static String getStackTrace() {
        StackTraceElement[] stack = new Throwable().getStackTrace();
        return stack[stack.length - 1].getClassName();

    }


    /**
     * 停止
     */
    @Override
    public void stop() {
        System.exit(0);
    }
}
